//***多态的学习***

class Anima {

    public void makeSound() {
        System.out.println("动物发出声音");
    }
}

class Dg extends Anima{
    @Override
    public void makeSound() {
        System.out.println("汪汪汪");
    }
}

class Cat extends Anima {
    @Override
    public void makeSound() {
        System.out.println("喵喵喵");
    }
}

public class duotai {
    public static void main(String[] args) {
        Anima anima1 = new Dg();
        Anima anima2 = new Cat();
        anima1.makeSound();
        anima2.makeSound();
        makeAnimalSound(new Dg());
        makeAnimalSound(new Cat());
    }

    public static void makeAnimalSound(Anima anima) {
        anima.makeSound();
    }
}
